@import "common";
@import "hot";

// 定位居中
@mixin position_center($type:absolute) {
  position: $type;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  margin: auto;
}

// 定位顶部
@mixin position_top($type:absolute) {
  position: $type;
  left: 0;
  right: 0;
  top: 0;
  margin: 0 auto;
}

// 定位右方
@mixin position_right($type:absolute) {
  position: $type;
  right: 0;
  bottom: 0;
  top: 0;
  margin: auto 0;
}

// 定位底部
@mixin position_bottom($type:absolute) {
  position: $type;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
}

// 定位左方
@mixin position_left($type:absolute) {
  position: $type;
  left: 0;
  bottom: 0;
  top: 0;
  margin: auto 0;
}

// 点击 波浪效果1
.click {
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;

  &:after {
    content: "";
    display: inline-block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border-radius: 50%;
    background: radial-gradient(circle, $color-white 100%, transparent 100%) no-repeat center center / 100% 100%;
    opacity: 0;
    transition: all 0.3s, opacity 0.5s;
  }

  &:active:after {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-size: 0 0;
    opacity: 0.3;
    transition: 0s;
  }
}

// 点击 波浪效果2
.click_ac {
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;

  &:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #41556c 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.3s, opacity 0.5s;
  }

  &:active:after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
  }
}

// 文字超出 显示省略号
.text_hide {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-disable-allow-scroll {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

// 文字超出 显示省略号
@mixin text_hide($num:1) {
  word-break: break-all;
  word-wrap: break-word;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: $num;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

// 弹性布局 垂直方向
@mixin dfc($type: space-between) {
  display: flex;
  justify-content: $type;
  flex-wrap: nowrap;
  flex-direction: column;
}

// 弹性布局 横向方向
@mixin dfr($content:space-between,$wrap:nowrap) {
  display: flex;
  justify-content: $content;
  flex-wrap: $wrap;
}

.hiddenX {
  overflow-x: hidden;
  overflow-y: auto;
}

.hiddenY {
  overflow-y: hidden;
  overflow-x: auto;
}

.fx-select-dropdown {
  display: inline-block;
  width: 20px;
  min-width: 20px;
  text-align: center;
  transform-origin: center center;
  transition: all 0.3s;
  position: relative;

  &::before, &::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    width: 8px;
    height: 1px;
    background-color: #000;
    transform-origin: center center;
    transform: rotate(45deg);
    transition: all 0.15s;
  }

  &::after {
    left: 9px;
    transform: rotate(-45deg);
  }

  &.active {
    &::before {
      transform: rotate(-45deg);
    }

    &::after {
      transform: rotate(45deg);
    }
  }
}

// hover 滚动条
.hover_bar {
  &::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 10px;
    transition: all 0.3s;
  }

  &:hover::-webkit-scrollbar-thumb {
    background-color: #d9dee6;
  }
}

.dib {
  display: inline-block;
}

@keyframes pop-ups-enter {
  from {
    transform: translateY(-40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pop-ups-leave {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-40px);
    opacity: 0;
  }
}

@keyframes modal-enter {
  from {
    background-color: rgba(0, 0, 0, 0);
  }
  to {
    background-color: rgba(0, 0, 0, 0.5);
  }
}

@keyframes modal-leave {
  to {
    background-color: rgba(0, 0, 0, 0);
  }
}

input {
  outline: none;

  &::-webkit-input-placeholder {
    color: $font-color-default !important;
  }
}
